package dk.hewison.client.panels;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.VerticalPanel;
import dk.hewison.client.component.MyImage;
import dk.hewison.client.domain.Photo;

/**
 * @author John Hewison
 * @author $LastChangedBy: john.hewison $:  $ $LastChangedDate: 2009-02-09 12:39:39 +0000 (Mon, 09 Feb 2009) $:
 * @version $Revision: 363 $:
 */
public class PhotoHolder extends Composite {

    public static final int SIZE = 150;

    Photo photo;
    MyImage myImage;

    public PhotoHolder(Photo photo) {
        this.photo = photo;
        myImage = new MyImage(photo);


        VerticalPanel panel = new VerticalPanel();
        panel.add(myImage);
        panel.setCellVerticalAlignment(myImage, VerticalPanel.ALIGN_MIDDLE);
        panel.setCellHorizontalAlignment(myImage, VerticalPanel.ALIGN_CENTER);


        initWidget(panel);
        setPixelSize(SIZE, SIZE);
        setStyleName("photothumbnail");
    }
}
